#include <iostream>
#include "MyArray.h"

using namespace std;

int main(int argc, char const *argv[])
{
        MyArray a1(10);

        for (int i = 0; i < a1.length(); i++)
        {
                //a1.setData(i, i);
                a1[i] = i;
                //a1.operator[](i)
                //void operator[](int i)
        }

        cout<<"打印a1: ";
        for (int i = 0; i < a1.length(); i++)
        {
                //cout<<a1.getData(i)<<" ";
                cout<<a1[i]<<" ";
        }
        cout<<endl;

        MyArray a2 = a1;
        cout<<"打印a2: ";
        for (int  i = 0; i < a2.length(); i++)
        {
                //cout<<a2.getData(i)<<" ";
                cout<<a2[i]<<" ";
        }
        cout<<endl;

        MyArray a3(5);
        {
                
                a3 = a1;
                a3 = a2 = a1;
                cout<<"打印a3: ";
                for (int  i = 0; i < a3.length(); i++)
                {
                        cout<<a3[i]<<" ";
                }
                cout<<endl;
        }

        if(a3 == a1)
        {
                cout<<"相等"<<endl;        
        }else{
                cout<<"不相等"<<endl;
        }


        if(a3 != a1)
        {
                cout<<"不相等"<<endl;
        }else{
                cout<<"相等"<<endl; 
        }

        return 0;
}
